{extend name='public/layout' /}

{block name='body'}
<div class="layui-card">
	<div class="layui-card-body">
		<form method="post" action="{:url()}" class="layui-form layui-form-edit">
			<input type="hidden" name="id" value="{$info.id|default=0}">
			<input type="hidden" name="http_referer" value="{$Request.server.HTTP_REFERER|default=''}"/>

			<div class="layui-form-item">
				<label class="layui-form-label" for="title">标题</label>
				<div class="layui-input-block">
					<input type="text" id="title" name="title" value="{$info.title|default=''}" placeholder="请输入标题" class="layui-input" lay-verify="required" autocomplete="on"/>
					<div class="layui-form-mid"></div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="name">标识<i class="required"></i></label>
				<div class="layui-input-block">
					<input type="text" id="name" name="name" value="{$info.name|default=''}" placeholder="请输入唯一标识" class="layui-input" lay-verify="required"/>
					<div class="layui-form-mid">只能是字母、数字和下划线_及破折号-</div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="type">类型<i class="required"></i></label>
				<div class="layui-input-inline">
					<select id="type" name="type" lay-verify="required">
						<option value="0">PC端</option>
						<option value="1">小程序</option>
					</select>
					<div class="layui-form-mid"></div>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label" for="status">状态</label>
				<div class="layui-input-inline">
					<input type="hidden" name="status" value="0"/>
					<input type="checkbox" id="status" name="status" value="1" lay-filter="status" lay-skin="switch" lay-text="启用|禁用"/>
					<div class="layui-form-mid"></div>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button type="submit" class="layui-btn layui-btn-danger" data-ajax-post="{target:'.layui-form'}">
						<i class="fa fa-save"></i> 保存
					</button>
					<a href="javascript:history.back();" class="layui-btn layui-btn-primary">取消 </a>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}

{block name='scriptVar'}
xin.setValue('#type',{$info.type|default='0'});
xin.setChecked('#status',{$info.status|default='1'});
{/block}
